var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
    })(e, t);
}, function(e, t) {
    function n() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, 
    new n());
}), a = this && this.__decorate || function(e, t, o, n) {
    var c, s = arguments.length, a = s < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(e, t, o, n); else for (var l = e.length - 1; 0 <= l; l--) (c = e[l]) && (a = (s < 3 ? c(a) : 3 < s ? c(t, o, a) : c(t, o)) || a);
    return 3 < s && a && Object.defineProperty(t, o, a), a;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("Global"), s = e("AudioManager"), c = e("GameConfig"), l = e("GameData"), d = e("UIManager"), u = e("WebManager"), p = cc._decorator, h = p.ccclass, f = (p.property, 
function(e) {
    function t() {
        return null !== e && e.apply(this, arguments) || this;
    }
    return i(t, e), t.prototype.onLoad = function() {
        var e, t = this;
        console.log("osMainVersion", cc.sys.osMainVersion, "osVersion", cc.sys.osVersion), 
        GA.PA && GA.PA.getSystemInfoSync ? (e = GA.PA.getSystemInfoSync(), cc.sys.osMainVersion < 7 || e && "Xigua" == e.appName ? this.node.active = !1 : GA.PA.checkShortcut({
            success: function(e) {
                console.log("checkShortcut success", e), r.G.isExist = e.status.exist, r.G.isExist ? t.node.active = !1 : cc.tween(t.node).repeatForever(cc.tween().to(.16, {
                    angle: 8
                }).to(.16, {
                    angle: -8
                }).to(.08, {
                    angle: 0
                }).to(.16, {
                    angle: 8
                }).to(.16, {
                    angle: -8
                }).to(.08, {
                    angle: 0
                }).delay(2)).start();
            },
            fail: function(e) {
                console.log("checkShortcut fail", e);
            }
        })) : cc.tween(this.node).repeatForever(cc.tween().to(.16, {
            angle: 8
        }).to(.16, {
            angle: -8
        }).to(.08, {
            angle: 0
        }).to(.16, {
            angle: 8
        }).to(.16, {
            angle: -8
        }).to(.08, {
            angle: 0
        }).delay(2)).start();
    }, t.prototype.onClick = function() {
        var e, t;
        s.default.getInstance().playAudio("按钮2"), GA.Info.underCheck && c.GC.isDebug ? (d.default.getInstance().hideAllPnl(), 
        PD.tag = "desktop", PD.data = {}, d.default.getInstance().loadPnl("eggsDesktop")) : GA.PA && (u.default.getInstance().sentLog("点击添加有礼按键"), 
        r.G.isExist ? null === (t = null === (e = GA.PA) || void 0 === e ? void 0 : e.showToast) || void 0 === t || t.call(e, {
            title: "已添加到桌面",
            icon: "none"
        }) : c.GC.isVaild("desktop") || l.GD.isAddToDesktop ? GA.PA.addShortcut({
            success: function(e) {
                console.log("addShortcut success", e), GA.PA.checkShortcut({
                    success: function(e) {
                        console.log("checkShortcut success", e), r.G.isExist = e.status.exist;
                    },
                    fail: function(e) {
                        console.log("checkShortcut fail", e);
                    }
                });
            },
            fail: function(e) {
                console.log("addShortcut fail", e);
            }
        }) : (d.default.getInstance().hideAllPnl(), PD.tag = "desktop", PD.data = {}, d.default.getInstance().loadPnl("eggsDesktop")));
    }, a([ h ], t);
}(cc.Component));

n.default = f;